<%@ page language="java" import="java.util.*" pageEncoding="Utf-8"%>
<%@taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>酒店统计</title>
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/base.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/style/page.css" type="text/css" media="screen" />
<link rel="stylesheet" href="${pageContext.request.contextPath}/common/src/css/jscal2.css" type="text/css" media="screen" />
<script src="${pageContext.request.contextPath}/common/js/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/js/common.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/src/js/jscal2.js" type="text/javascript"></script>
<script src="${pageContext.request.contextPath}/common/src/js/lang/cn.js" type="text/javascript"></script>
<script >
$(function(){
	$("#export").click(function(){
		$.ajax({
			dataType:"json",
			type:"post",
			url:"exportData.action",
			success:function(json){
				if(json.success){
				$("#filedown").html('<a href="${pageContext.request.contextPath}/'+json.path+'"><span>xia</span></a>');
				$("#filedown span").click();
				}
				else if(json.msg==2){alert("导出失败");
				}
			}
		})
		
	})
})

function exportSelect(){
	var ids=getselects();
	if(ids!=""){
	$.ajax({
			dataType:"json",
			type:"post",
			url:"exportData.action",
			data:"ids="+ids,
			success:function(json){
				if(json.success){
				$("#filedown").html('<a href="${pageContext.request.contextPath}/'+json.path+'"><span>xia</span></a>');
				$("#filedown span").click();
				}
				else if(json.msg==2){alert("导出失败");
				}
			}
		})
	}else {alert("请选择要导出的数据");return;}
}
</script>
	</head>
	<body>
<div id="main_frame">	

	<span id="filedown" style="display:none;"></span>
	<div id="pagemenu"><a href="javascript:void(0);" title="统计列表"  class="selected">统计列表</a>|
	<a href="javascript:void(0);"  class="searchlink"  title="搜索">搜索</a>
	|<a href="getHotRoomListByPage.action?type=1" >统计图表</a>|<a href="javascript:void(0);"  id="export">导出全部统计数据</a></div>
	<div class="searchbox" style="display:none">
		<form action="search.action" method="post">
		时间：<input type="text" class="dateinput1" id="startDate" name="startDate"/>-<input type="text" class="dateinput1" id="endDate" name="endDate"/>
		<script type="text/javascript">
			Calendar.setup({
				inputField : "startDate",
				trigger    : "startDate",
				dateFormat: "%Y-%m-%d",
				minuteStep: 1,
				onSelect   :  function() {
					this.hide();
					if(($("#endDate").val()!=""&&($("#startDate").val()>$("#endDate").val())))
							{
								alert("不能大于结束时间.");
								$("#startDate").val("");
								return ;
							}
				}
			});
				Calendar.setup({
				inputField : "endDate",
				trigger    : "endDate",
				dateFormat: "%Y-%m-%d",
				minuteStep: 1,
				onSelect   :  function() {
					this.hide();
					if(($("#startDate").val()!=""&&($("#endDate").val()<$("#startDate").val())))
							{
								alert("不能小于开始时间.");
								$("#endDate").val("");
								return ;
							}
				}
			});
		</script>
		<input type="submit" value="搜索" class="cancelbtn" style="margin-top:0;"/>
		</form>
	</div>
	<div class="listbox">	
	<table class="listtab"  align="center">
		<thead>
			<tr>
				<th width="42"><span class="mline"><input type="checkbox" name="checkbox" id="checkbox" onclick="selectall(this);" /></span></th>				
				<th class="tl pdl10"><span class="mline">房间名称</span></th>
				<th width="120"><span class="mline">总订单数</span></th>
				<th width="120"><span class="mline">取消订单数</span></th>
				<th width="120"><span class="mline">成交订单数</span></th>
				<th width="120">成交金额</th>
			</tr>
		</thead>
		<tbody>			
		<s:iterator value="resultlist"  var="x">
			<tr>	
				<td><input type="checkbox" name="checkbox" value="${x.roomStyleId}" class="ckbox"/></td>			
				<td class="tl pdl10">${x.roomName}</td>
				<td>${x.all}</td>
				<td>${x.cancel}</td>
				<td>${x.ordernum}</td>			
				<td>${x.totalMoney }</td>
			</tr>
		</s:iterator>
		</tbody>
	</table>
	</div>

</div>
<div id="bottombar">
	<div class="fl">
	<span><a onclick="selectall(true);" href="javascript:void(0);">全选</a>/<a onclick="selectall(false);" href="javascript:void(0);">取消</a></span>
	<a href="javascript:void(0);" onclick="exportSelect();" title="导出" class="addsource">导出</a>
	</div>
</div>
</body>
</html>